import { axiosGet, axiosPost, axiosPut, axiosDelete } from '/@/api/RequestBase';
import { AdminResultListMenuOutput } from '/@/api-services/models';
import { BasZhanDianMenuInput } from './dto/BasZhanDianMenuInput';
import { BasZhanDianMenuOutput } from './dto/BasZhanDianMenuOutput';
import { BasZhanDianMenuTreeOutput } from './dto/BasZhanDianMenuTreeOutput';

export type { BasZhanDianMenuInput, BasZhanDianMenuOutput, BasZhanDianMenuTreeOutput };

const service = 'BasZhanDianMenu/'; // 要写后面的斜杠, 不要写前面的斜杠

export const BasZhanDianMenuApi = {
	getLoginMenuTreeByZhanDian: (data: BasZhanDianMenuInput) => {
		return axiosPost<[AdminResultListMenuOutput]>(service + 'getLoginMenuTreeByZhanDian', data);
	},
	all: () => {
		return axiosPost<BasZhanDianMenuOutput[]>(service + 'all', {});
	},
	allTree: () => {
		return axiosPost<BasZhanDianMenuTreeOutput>(service + 'allTree', {});
	},
	addRange: (data: BasZhanDianMenuInput[]) => {
		return axiosPost<BasZhanDianMenuTreeOutput>(service + 'addRange', data);
	},
	delete: (id: number) => {
		return axiosDelete<boolean>(service + `delete/${id}`);
	},
};
